package edu.zjut.sjq.mapper;

import edu.zjut.sjq.bean.Article;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface ArticleMapper {
    Article getArticleById(Integer id,Integer userId);

    int insert(Article record);

    List<Article> getArticleListOrderByTime(@Param("year") Integer year, @Param("type") Integer type,
                                            @Param("tag") Integer tag, @Param("begin") Date begin,
                                            @Param("userId") Integer userId);
    // 成绩从大到小
    List<Article> getArticleListOrderByGreat(Integer year);

    List<Article> getArticleListOrderByLike(Integer year);

    List<Article> getLatestArticleList(@Param("userId") Integer userId,@Param("limitNum") Integer limitNum,
                                       @Param("excludeId") Integer excludeId);
    //
    List<Article> getUncheckedArticle(@Param("year") Integer year,@Param("userId") Integer userId);

    Integer updateArticleGrate(Integer id,Double great);
}